<?php include("head.php"); 
    include("conn.php");
    //需要对kid做一个验证
    $kid = empty($_GET["kid"])?"null":$_GET["kid"];
    if($kid=="null"){
        die("请输入正确的参数！");
    }
	//执行查询sql
    $sql = "select * from `选修` where id='{$kid}'";
    $result = mysqli_query($conn,$sql);
    if( mysqli_num_rows($result)>0 ){
		//转成关联数组，因为这里确定只有一条记录，所以不用while循环
		$arr = mysqli_fetch_assoc($result);
    }else{
        echo "找不到这条记录";
    }
?>
    <div class="sui-layout">
		  <div class="sidebar">
<?php include("leftmenu.php"); ?>	  	
		  </div>
          <div class="content">
		  <p class="sui-text-xxlarge my-padd">学生成绩修改</p>
			<form action="chengji_save.php" method="get" class="sui-form form-horizontal sui-validate">
			  <input type="hidden" name="action" value="update">
			  <input type="hidden" name="id" value="<?php echo $arr['id']?>">
			  <!-- <div class="control-group">
			    <label for="sids" class="control-label">sid：</label>
			    <div class="controls">
			      <input name="sids" type="text" id="sids" class="input-large input-fat" placeholder="输入sid" data-rules="required|minlength=0|maxlength=1000" value="">
			    </div>
			  </div> -->
			  <!-- <div class="control-group">
			    <label for="id" class="control-label">id：</label>
			    <div class="controls">
			      <input name="id" type="text" id="id" class="input-large input-fat" placeholder="输入学号" data-rules="required|minlength=2|maxlength=10" value="">
			    </div>
			  </div> -->
			  <div class="control-group">
			    <label for="xuehao" class="control-label">学号：</label>
			    <div class="controls">
			      <input name="xuehao" type="text" id="xuehao" class="input-large input-fat"  placeholder="输入学生姓名" data-rules="required|minlength=2|maxlength=10" value="<?php echo $arr['学号']?>">
			    </div>
			  </div>
			  <div class="control-group">
			    <label for="kcbianhao" class="control-label">课程编号：</label>
			    <div class="controls">
			      <input name="kcbianhao" type="text" id="kcbianhao" class="input-large input-fat"  placeholder="输入学生籍贯" data-rules="required|minlength=2|maxlength=10" value="<?php echo $arr['课程编号']?>">
			    </div>
			  </div>
			  <div class="control-group">
			    <label for="chengji" class="control-label">成绩：</label>
			    <div class="controls">
			      <input name="chengji" type="text" id="chengji" class="input-large input-fat"  placeholder="输入学生手机号" data-rules="required|minlength=2|maxlength=11" value="<?php echo $arr['成绩']?>">
			    </div>
			  </div>			  
			  <div class="control-group">
			  	<label class="control-label"></label>
			  	<div class="controls">
			  		<input type="submit" value="修改" name="" class="sui-btn btn-large btn-primary">
			  	</div>
			  </div>	  
			</form>
		  </div>
		</div>		
    </div>
<?php include("foot.php"); ?>